<!-- 好像无组件引入过 -->
<template>
	<view class="all">
		<uni-popup ref="popup">
			<view class="Popup">
				<view class="popHeader">
					<view class="">

					</view>
					<view class="title">{{title}}</view>
					<view class="close" @click="closePage">
						<uni-icons type="closeempty" size="20" color="#999"></uni-icons>
					</view>
				</view>
				<view class="content">
					<slot name="content"></slot>
				</view>
				<view class="footer">
					<button type="default" size="mini" plain @click="confirm"> 确定</button>
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script setup>
	import {
		ref,
		computed,
		onMounted
	} from "vue"
	import {
		onLoad,
		onReady,
		onPageScroll,
		onShow,
		onReachBottom
	} from "@dcloudio/uni-app"

	const props = defineProps({
		title: {
			type: String,
			default: '标题'
		}
	});

	const popup = ref(null)

	const showPage = () => {
		popup.value.open()
	}

	const closePage = () => {
		popup.value.close()
	}


	const confirm = () => {
		// 逻辑处理，修改状态

		popup.value.close()
	}

	defineExpose({
		showPage
	})
</script>

<style lang="scss" scoped>
	.all {
		position: relative;

		.popHeader {
			display: flex;
			justify-content: space-between;
			align-items: center;

			.title {
				color: $text-font-color-2;
				font-size: 26rpx;
			}

			.close {
				padding: 6rpx;
			}
		}

		.Popup {
			background: #fff;
			padding: 30rpx;
			width: 70vw;
			border-radius: 30rpx;

			.content {
				padding: 30rpx 0;
				display: flex;
				justify-content: center;
				align-items: center;
				gap: 20rpx;

				.text {
					color: #FFCA3E;
					padding-left: 10rpx;
					width: 80rpx;
					line-height: 1em;
					text-align: right;
				}
			}

			.footer {
				display: flex;
				padding: 10rpx 0;
				align-items: center;
				justify-content: center;
			}
		}
	}
</style>